package com.xt.purchasingsystem.mapper;

import com.xt.purchasingsystem.model.MProceduring;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface MProceduringMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(MProceduring record);

    int insertSelective(MProceduring record);

    MProceduring selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(MProceduring record);

    int updateByPrimaryKey(MProceduring record);

    /**
     * 根据生产总表编号查询此所有未审核的生产工序
     * @param mmanufactureId
     * @return
     */
    List<MProceduring> getAllNotCheckByMmanufactureId(Integer mmanufactureId);

    /**
     * 根据父级序号,工序编号,工序名称查询最近一次登记次数
     *
     * @param parentId
     * @param procedureId
     * @param procedureName
     * @return
     */
    Integer regCount(@Param("parentId") Integer parentId, @Param("procedureId") Integer procedureId, @Param("procedureName") String procedureName);

    /**
     * 根据ID修改工时数和工时成本小计
     * @param id
     * @param amount
     * @param subtotal
     * @return
     */
    int updateHourAmountAndSubtotal(@Param("id") Integer id, @Param("amount") Double amount, @Param("subtotal") Double subtotal);

}